c# remove all null from list

54

c# remove all null from list -

List<EmailParameterClass> parameterList = new List<EmailParameterClass>{param1, param2, param3...};
parameterList.RemoveAll(item => item == null);

c# remove all items from list where item value is null -

parameterList = parameterList.Where(x => x != null).ToList();

Comments

Submit
0 Comments